
<div class="content-box">
    <div class="box-header clear">
        <ul class="tabs clear">
            <li><a href='<?php echo base_url() ?>member/add' class="selected"><?php echo lang('btn_add') ?></a></li>
        </ul>
        <h2><?php echo lang('pg_member') ?></h2>
    </div>
    <div class="box-body clear">
        <div id="data-table">
        	<?php echo form_open(base_url() . 'member/search'); ?>
            <div class="form-field clear">
                <label class="form-label fl-space2"><?php echo lang('lbl_full_name')."/".lang('lbl_email') ?> :</label>
                <input type="input" value="<?php echo set_value('full_name',$full_name); ?>" name="full_name" id="full_name" class="text" />
            </div>
            <div class="form-field clear">
                <label class="form-label fl-space2"><?php echo lang('lbl_gender') ?> :</label>
                <?php echo form_dropdown('gender', $gender, $gender_value); ?>
            </div>
            <!--<div class="form-field clear">
                <label class="form-label fl-space2"><?php echo lang('lbl_my_owner') ?> :</label>
                <input type="checkbox" name="owner" value="1" />
            </div>-->
            <div class="form-field clear">
                <label class="form-label fl-space2"><?php echo lang('lbl_owner') ?> :</label>
                <select name="owner_id">
                <option value=""><?php echo lang('lbl_select_owner');?></option>
                <?php 
                foreach($owners as $item){
					echo '<option value="'.$item->id.'" '.($item->id == $owner_id ? 'selected="selected"': '').'>'.$item->username.'</option>';
				}
                ?>
                </select>
                <input type="submit" value="<?php echo lang('btn_search');?>" />
            </div>
            <?php echo form_close(); ?>
                <table class="datatable">
                    <thead>
                        <tr>
                            <th><?php echo lang('lbl_full_name') ?></th>
                            <th><?php echo lang('lbl_email') ?></th>
                            <th><?php echo lang('lbl_phone') ?></th>
                            <th><?php echo lang('lbl_address') ?></th>
                            <th></th>
                        </tr>
                    </thead>
                    <tbody>

                        <?php foreach ($members as $key => $item): ?>
                            <tr id="row<?php echo $key; ?>">
                                <td><?php echo $item->first_name." ".$item->last_name; ?></td>
                                <td><?php echo $item->email; ?></td>
                                <td><?php echo $item->phone; ?></td>
                                <td><?php echo $item->address; ?></td>
                                <td>
                                    <a href="<?php echo base_url() ?>member/edit/<?php echo $item->id; ?>">
                                    	<img title="<?php echo lang('lbl_edit') ?>" alt="" class="icon16 fl-space2" src="<?php echo base_url().SKINSPATH; ?>admin/images/ico_edit_16.png">
                                    </a>
                                    <a href="javascript:remove('row<?php echo $key; ?>','<?php echo base_url() ?>member/delete','<?php echo $item->id; ?>')">
                                    	<img title="<?php echo lang('lbl_delete') ?>" alt="" class="icon16 fl-space2" src="<?php echo base_url().SKINSPATH; ?>admin/images/ico_delete_16.png">
                                    </a>
                                    <a href="<?php echo base_url() ?>contract/member/<?php echo $item->id; ?>">
                                    	<?php echo lang('lbl_contract');?>
                                    </a>
                                </td>
                            </tr>

                        <?php endforeach; ?>
                    </tbody>
                </table>
        </div>
    </div>
</div>